<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>再搜索用户重置密码</title>
<link href="<%=path%>/static/css/all.css?jejwej33we" rel="stylesheet" type="text/css">
<!--[if IE]>
<script>
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
</script>
<![endif]-->
</head>

<body>
<header>
<div id="topnav">
  <div class="topnav">
    <ul>
      <li><a href="<%=path%>/web/garbage/index" title="">首页</a></li>
      <li><a href="#" title="">关于我们</a></li>
      <li><a href="graphers.html" title="">开发团队</a></li>
    </ul>
    <ol>
      <li><a href="<%=path%>/web/userinfo/login">登录</a>/<a href="<%=path%>/web/userinfo/register">注册</a></li>
    </ol>
  </div>
  </div>
</header>
<section>
<div class="wrap">
    <div id="register">
      <div class="logo"><img src="<%=path%>/static/images/registerlogo.png" width="300" height="50" alt="分类搜索"></div>
      <div class="respont">
        <h1>重置密码</h1>
        <form action="<%=path%>/web/userinfo/finish" method="post" id="re-password">
          <ol>
            <li>
              <input name="password" type="password" maxlength="16" id="password" aria-label="输入新密码" placeholder="输入新密码">
            </li>
            <li class="mgs">
              <input name="rePassword" id="rePassword" type="password" aria-label="再次输入密码" placeholder="再次输入密码">
              <label>请保持两次输入密码一致</label>
            </li>
            <li>
              <input class="submit" name="input6" type="submit" value="提交修改密码">
            </li>
          </ol>
        </form>
      </div>
    </div>
  </div>
</div>
</section>
<footer>
  <div id="footer">
    <div id="footernav"> <a href="#">返回顶部</a> <span>|</span> <a href="#">联系方式</a> <span>|</span> <a href="#">网站地图</a> <span>|</span> <a href="#">版权说明</a> </div>
    <div id="copyright">
      <p>copright qingsoft2013 web设计 <a href="HTTP://www.songshuo.com" target="_blank">宋硕设计网站设计工作室</a></p>
    </div>
  </div>
</footer>
<script src="<%=path%>/static/js/jquery-3.3.1.min.js"></script>
<script src="<%=path%>/static/js/layui/layui.all.js"></script>
<script>
  $(document).ready(function () {
    $("#password").blur(checkPassword);
  });
  function checkPassword(){
    var regExp = /^(?![A-Z]+$)(?![a-z]+$)(?!\d+$)\S{8,}$/;
    var password = $("#password").val();
    var f = false;
    if(regExp.test(password)){
      f=true;
    }
    else{
      layer.msg("密码长度不低于8位，至少含有一个数字和一个字母",{icon: 5})
      f=false;
    }
    return f;
  }

  $(document).ready(function () {
    $("#rePassword").blur(rePassword)
  });
  function rePassword() {
    var rePassword = $("#rePassword").val();
    var password = $("#password").val();
    var f = false;
    if (password != rePassword) {
      layer.msg("两次密码不一致，请重新输入", {icon: 5})
      f=false;
    }
    else {
      f=true;
    }
    return f;
  }

  $(document).ready(function () {
    $("#re-password").submit(
            function () {
              var flagPassword = checkPassword();
              var flagRePassword = rePassword();
              return flagPassword&&flagRePassword;
            })
  })
</script>
</body>
</html>
